package fun.gladlee.smartmsg.receiver;

import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;
import android.os.Bundle;
import android.telephony.SmsMessage;

/**
 * @author gladlee
 *         Date: 13-5-11
 *         Time: 上午2:06
 */
public class SmsMsgReceiver  extends BroadcastReceiver{
    private static final String TAG = "SmsMsgReceiver";
    @Override
    public void onReceive(Context context, Intent intent) {
        Bundle bundle = intent.getExtras();
        if (bundle == null) {
            return;
        }
        Object[] pdus = (Object[]) bundle.get("pdus");
        for (int i = 0; i < pdus.length; i++) {
            SmsMessage msg = SmsMessage.createFromPdu((byte[]) pdus[i]);
            String msgBody = msg.getMessageBody();

        }
    }
}
